﻿<?php
	/*老师模糊查询表格           根据id搜索*/
 	('Access-Control-Allow-Origin：*');
	include("mysql.php");
	$id=$_REQUEST['id'];
    $classify=$_REQUEST['classify'];
    //$classify == "teachers" 是在老师页面查询所有老师  $classify == "student" 是所有报名学生列表的合并查询
	if($classify == "teachers"){
		$sql = "select * from ".$classify." where id = '{$id}'";
	}else{
		$sql = "select s.id,s.tid,s.name,s.phone,s.cardid,s.mail,s.sosperson,s.sosphone,s.cengci,t.tname,s.school,s.major,s.money,s.ispay,s.creattime,s.educationType,s.remarks,s.isTi,s.oweafee,s.isBao,s.chengben,s.unifiedExam,s.paper,s.baccalaureate FROM students s INNER JOIN teachers t ON s.tid = t.id where s.id = '{$id}'";
	}
     /*创建新的连接对象并使用new 对象的方法*/
    $Mysql = new Mysql();
    /*根据查询语句返回列表*/
	$arrsd = $Mysql->likeSelect($sql);
	/*返回出去*/
	echo $arrsd;
	/*关闭连接*/
    $Mysql->close();

?>